<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ page contentType="text/html; charset=UTF-8" import="user.*"%> 
<%@ page import="java.sql.*"%> 

<HEAD><TITLE>Registration</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">

</HEAD>

<BODY leftMargin=0 topMargin=10>

<TABLE cellSpacing=0 cellPadding=0 width=700 align=center border=0>
  <TBODY>
  <TR>
    <TD>
      <DIV align=center><A href="index.jsp"><IMG height=118 
      src="Pics/restaurantLogo.JPG" width=242 
  border=0></A></DIV></TD></TR></TBODY></TABLE>

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<tr><td><table width = 60% align = center>
<%
    	Object UserTypeObject = session.getAttribute("uType");
    	String RestID = null;
		//if the current user is a restaurant
		if (UserTypeObject != null && UserTypeObject.toString().equals("2"))
		{
			Object restIDObject = session.getAttribute("id");	
			//out.println("Restaurant id is : " + session.getAttribute("id"));		
			if (restIDObject!= null)
			{
				RestID = restIDObject.toString();
			%>
			<%=DisplayRestaurantPage.getSelectedRestaurantName(RestID) %>
			<%}
    	}
 %>
</table></td></tr>
<TR>
    <TD vAlign=top height=60>
    <TABLE cellSpacing=1 cellPadding=3 width="60%" align=center bgColor=#cccccc>
    <tr bgColor=#bbbbbb><td align = center colspan = 5>Profit</td></tr>
    <%=DisplayRestaurantPage.getRestaurantProfitLoss(RestID)%>
    <tr><td></td></tr>
    </TABLE>
    </TD>
      </TR>
      
      <tr><td>
      <form action = "restaurant_account.jsp">
      <TABLE cellSpacing=1 cellPadding=3 width="60%" align=center bgColor=#cccccc>
      <tr bgColor=#bbbbbb><td align = center colspan = 5>The Food Sale</td></tr>
      <tr><td>Keyword : <input name="food_search" type="text" class="input" size="20"></td>
      <td>Order By</td>
      <td><input name = 'Order_By_Price' type = 'radio' class = 'input' value ='Order_By_Price'>Price</td>
      <td><input name = 'Order_By_Sales' type = 'radio' class = 'input' value ='Order_By_Sales'>Sales</td>
      <td><input name = 'Order_By_FoodName' type = 'radio' class = 'input' value ='Order_By_FoodName'>Food Name</td>
      </tr>
      <tr><td><INPUT type=submit value=search name=SubmitFoodSearch></td></tr>  
      </TABLE></form>
      
      <TABLE cellSpacing=1 cellPadding=3 width="60%" align=center bgColor=#eeeeee>
      <%
      	//DBConnector db = DBConnector.getDBConnector();	
		String SubmitFoodSearch = request.getParameter("SubmitFoodSearch");
		if (SubmitFoodSearch != null && SubmitFoodSearch.length() > 0) {
			String food_search = request.getParameter("food_search");
			String Order_By_FoodName = request.getParameter("Order_By_FoodName");
			String Order_By_Restaurant = request.getParameter("Order_By_Restaurant");
			String Order_By_Price = request.getParameter("Order_By_Price");
			String Order_By_Sales = request.getParameter("Order_By_Sales");
		%>
        
        
	<%=DisplayFoodPage.DisplayFoodListForRestaurant(food_search,Order_By_FoodName,Order_By_Restaurant,Order_By_Price,Order_By_Sales,RestID) %>
	<%} %>
		<tr><p><a href="./food_addition.html">Add New Food</a></p></tr>     
      </TABLE>       
      </td></tr>
      
      </TABLE>  
</BODY>
